home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / intern1a / frmmain.frm < prev    next >
Text File  |  1999-10-03  |  9KB  |  326 lines

  1. VERSION 5.00
  2. Object = "{608009F3-E1FB-11D2-9BA1-0040D0002C80}#1.0#0"; "NSLOCK15VB6.OCX"
  3. Begin VB.Form frmMain 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Internet LOCKDOWN!"
  6.    ClientHeight    =   6165
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   5190
  10.    Icon            =   "frmMain.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    Moveable        =   0   'False
  15.    ScaleHeight     =   6165
  16.    ScaleWidth      =   5190
  17.    StartUpPosition =   2  'CenterScreen
  18.    Begin VB.TextBox Text1 
  19.       Height          =   285
  20.       IMEMode         =   3  'DISABLE
  21.       Left            =   3720
  22.       Locked          =   -1  'True
  23.       PasswordChar    =   "*"
  24.       TabIndex        =   8
  25.       Text            =   "Intruder"
  26.       Top             =   3720
  27.       Visible         =   0   'False
  28.       Width           =   1095
  29.    End
  30.    Begin VB.CommandButton Command2 
  31.       Caption         =   "Options"
  32.       Height          =   255
  33.       Left            =   3480
  34.       TabIndex        =   7
  35.       Top             =   0
  36.       Width           =   855
  37.    End
  38.    Begin VB.CommandButton Command1 
  39.       Caption         =   "Register"
  40.       Height          =   255
  41.       Left            =   0
  42.       TabIndex        =   6
  43.       Top             =   0
  44.       Width           =   975
  45.    End
  46.    Begin nslock15vb6.ActiveLock ActiveLock1 
  47.       Left            =   480
  48.       Top             =   3600
  49.       _ExtentX        =   847
  50.       _ExtentY        =   820
  51.       Password        =   "YourPassword"
  52.       SoftwareName    =   "Internet LOCKDOWN!"
  53.       LiberationKeyLength=   16
  54.       SoftwareCodeLength=   16
  55.    End
  56.    Begin VB.Timer Timer2 
  57.       Enabled         =   0   'False
  58.       Interval        =   1000
  59.       Left            =   3840
  60.       Top             =   5040
  61.    End
  62.    Begin VB.Timer Timer1 
  63.       Enabled         =   0   'False
  64.       Interval        =   1
  65.       Left            =   4200
  66.       Top             =   5040
  67.    End
  68.    Begin VB.CommandButton CmdPassword 
  69.       Caption         =   "OK"
  70.       Default         =   -1  'True
  71.       Enabled         =   0   'False
  72.       Height          =   255
  73.       Left            =   3480
  74.       TabIndex        =   2
  75.       Top             =   3120
  76.       Width           =   855
  77.    End
  78.    Begin VB.TextBox txtpassword 
  79.       Height          =   285
  80.       IMEMode         =   3  'DISABLE
  81.       Left            =   1680
  82.       PasswordChar    =   "*"
  83.       TabIndex        =   1
  84.       Top             =   3120
  85.       Width           =   1695
  86.    End
  87.    Begin VB.Label Label1 
  88.       Caption         =   "If you are off of the internet, click on the check."
  89.       ForeColor       =   &H00FF0000&
  90.       Height          =   255
  91.       Left            =   360
  92.       TabIndex        =   5
  93.       Top             =   5880
  94.       Width           =   3375
  95.    End
  96.    Begin VB.Image Image1 
  97.       Height          =   480
  98.       Left            =   3840
  99.       Picture         =   "frmMain.frx":030A
  100.       Top             =   5640
  101.       Width           =   480
  102.    End
  103.    Begin VB.Label lblCountdown 
  104.       Alignment       =   2  'Center
  105.       Caption         =   "180"
  106.       BeginProperty Font 
  107.          Name            =   "Comic Sans MS"
  108.          Size            =   72
  109.          Charset         =   0
  110.          Weight          =   400
  111.          Underline       =   0   'False
  112.          Italic          =   0   'False
  113.          Strikethrough   =   0   'False
  114.       EndProperty
  115.       ForeColor       =   &H0000FF00&
  116.       Height          =   1815
  117.       Left            =   1200
  118.       TabIndex        =   4
  119.       Top             =   3720
  120.       Width           =   2415
  121.    End
  122.    Begin VB.Label lblpassword 
  123.       Caption         =   "Enter Password:"
  124.       Height          =   255
  125.       Left            =   480
  126.       TabIndex        =   3
  127.       Top             =   3120
  128.       Width           =   1215
  129.    End
  130.    Begin VB.Label lblDescription 
  131.       BeginProperty Font 
  132.          Name            =   "MS Sans Serif"
  133.          Size            =   13.5
  134.          Charset         =   0
  135.          Weight          =   400
  136.          Underline       =   0   'False
  137.          Italic          =   0   'False
  138.          Strikethrough   =   0   'False
  139.       EndProperty
  140.       Height          =   2655
  141.       Left            =   720
  142.       TabIndex        =   0
  143.       Top             =   240
  144.       Width           =   3615
  145.    End
  146. End
  147. Attribute VB_Name = "frmMain"
  148. Attribute VB_GlobalNameSpace = False
  149. Attribute VB_Creatable = False
  150. Attribute VB_PredeclaredId = True
  151. Attribute VB_Exposed = False
  152.  
  153.  
  154. Public Function IsConnected() As Boolean
  155.  
  156.  
  157.     Dim TRasCon(255) As RASCONN95
  158.     Dim lg As Long
  159.     Dim lpcon As Long
  160.     Dim RetVal As Long
  161.     Dim Tstatus As RASCONNSTATUS95
  162.     '
  163.     TRasCon(0).dwSize = 412
  164.     lg = 256 * TRasCon(0).dwSize
  165.     '
  166.     RetVal = RasEnumConnections(TRasCon(0), lg, lpcon)
  167.  
  168.  
  169.     If RetVal <> 0 Then
  170.         MsgBox "ERROR"
  171.         Exit Function
  172.     End If
  173.  
  174.     '
  175.     Tstatus.dwSize = 160
  176.     RetVal = RasGetConnectStatus(TRasCon(0).hRasCon, Tstatus)
  177.  
  178.  
  179.     If Tstatus.RasConnState = &H2000 Then
  180.         IsConnected = True
  181.     Else
  182.         IsConnected = False
  183.     End If
  184.  
  185. End Function
  186.  
  187. Private Sub CmdPassword_Click()
  188. If txtPassword.Text = Text1.Text Then
  189. Unload Me
  190. Unload frmOptions
  191. Unload frmRegister
  192. Unload frmLogin
  193. Else
  194. MsgBox "Wrong Password!"
  195. End If
  196. End Sub
  197.  
  198.  
  199.  
  200. Private Sub Command1_Click()
  201. Load frmRegister
  202. frmRegister.Show
  203. End Sub
  204.  
  205. Private Sub Command2_Click()
  206. Load frmLogin
  207. frmLogin.Show
  208. End Sub
  209.  
  210.  
  211. Private Sub Command3_Click()
  212. DeleteSetting App.Title, "LockDown"
  213. End Sub
  214.  
  215.  
  216. Private Sub Form_Load()
  217. 'Retrieve Option Settings
  218. frmOptions.OptShutdown.Value = GetSetting(App.Title, "Lockdown", "OptShutdown")
  219. frmOptions.OptLogOff.Value = GetSetting(App.Title, "Lockdown", "Logoff")
  220. frmOptions.OptForce.Value = GetSetting(App.Title, "Lockdown", "Force")
  221. frmOptions.OptReboot.Value = GetSetting(App.Title, "Lockdown", "Reboot")
  222.  
  223. If ActiveLock1.RegisteredUser = False Then
  224. frmMain.Caption = "Internet LOCKDOWN!!  Evaluation day " & ActiveLock1.UsedDays & " of 21."
  225. Else
  226. frmMain.Caption = "Internet LOCKDOWN!!"
  227. End If
  228. lblCountdown.Caption = Countdown
  229. Countdown = GetSetting(App.Title, "Lockdown", "Countdown")
  230. lblCountdown.Caption = GetSetting(App.Title, "Lockdown", "Countdown")
  231. Text1.Text = GetSetting(App.Title, "Lockdown", "password")
  232.  
  233. ActiveLock1.Password = "powerauthority"
  234.  
  235. If Not (ActiveLock1.RegisteredUser) And ActiveLock1.UsedDays > 21 Then
  236.   MsgBox "Your evaluation period has expired! Now Shutting down program!"
  237. End If
  238. If (ActiveLock1.LastRunDate > Now) Then
  239.   MsgBox "Please, correct your time settings and try again!"
  240.   End
  241. End If
  242. If ActiveLock1.RegisteredUser Then
  243. Else
  244.   MsgBox "You haven't registered yet!  Please register today!"
  245.   MsgBox "You have " & 21 - ActiveLock1.UsedDays & " days left!"
  246.   Load frmRegister
  247.   frmRegister.Show
  248. End If
  249. Dim hSysMenu As Long
  250. hSysMenu = GetSystemMenu(hwnd, False)
  251. RemoveMenu hSysMenu, SC_CLOSE, MF_BYCOMMAND
  252. Timer1.Enabled = True
  253. frmMain.Visible = False
  254. App.TaskVisible = False
  255.     
  256. lblDescription.Caption = "Enter the correct password to be on the Internet.  You have " & Countdown & " seconds to disconnect, otherwise, the computer will restart and you will lose everything!"
  257.  
  258. End Sub
  259.  
  260. Private Sub Picture1_Click()
  261.  
  262. End Sub
  263.  
  264. Private Sub Image1_Click()
  265. If IsConnected = False Then
  266.     Timer1.Enabled = True
  267.     Timer2.Enabled = False
  268. Me.Visible = False
  269. Else
  270. MsgBox "Don't lie, you know you're not off."
  271. MsgBox "For that, the timer time will be cut in half!"
  272. Timer2.Interval = Timer2.Interval / 2
  273. End If
  274. End Sub
  275.  
  276. Private Sub Timer1_Timer()
  277. If IsConnected = True Then
  278. frmMain.Visible = True
  279. Timer2.Enabled = True
  280. End If
  281.  
  282. End Sub
  283.  
  284. Private Sub Timer2_Timer()
  285.  
  286. If lblCountdown.Caption = "" Then
  287. Load frmOptions
  288. frmOptions.Show
  289. Else
  290. If lblCountdown.Caption <= 60 Then
  291. lblCountdown.ForeColor = &HFF&
  292. End If
  293. lblCountdown.Caption =